home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 8166 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.7 KB

  1. Path: solon.com!not-for-mail
  2. From: seebs@solutions.solon.com (Peter Seebach)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Newbie doesn't understand compiler error
  5. Date: 1 Mar 1996 20:43:58 -0600
  6. Organization: Usenet Fact Police (Undercover)
  7. Message-ID: <4h8cle$cn4@solutions.solon.com>
  8. References: <Pine.SUN.3.91.960301153010.11258B-100000@pioneer.uspto.gov> <31378ECB.3B81@oc.com>
  9. NNTP-Posting-Host: solutions.solon.com
  10.  
  11. In article <31378ECB.3B81@oc.com>, Larry Weiss  <lfw@oc.com> wrote:
  12. > > int line, page;
  13. > > main( int argv, char *argc[] )  <<- Compiler states "Syntax error at or near
  14. > > {                                   word type char."
  15.  
  16. > > Do I need to update my compiler?
  17.  
  18. This is in the FAQ, of course...  And the answer is "yes".
  19.  
  20. >First off, you may have made a typo here, but the correct declaration of
  21. >main() is
  22.  
  23. >  main( int argc, char *argv[] ) 
  24. >               ^           ^ 
  25.  
  26. Now, now.  There's nothing *wrong* with the newbie's definition.
  27. Sure, it's stupid, unconventional, misleading, and a likely
  28. typo.  But there's nothing *wrong* with it.
  29.  
  30. >The compiler that Sun provides with SUNOS 4.1 does not support function
  31. >declarations of the type you are using.   This method was introduced into
  32. >the language at the most recent major standardization cycle. 
  33.  
  34. Which is to say, it was formalized by 1988-1989 or so, and Sun is a
  35. fascist bunch of evil !@#*!#'s not to have fixed it.
  36.  
  37. > main( argc, argv ) 
  38. > int argc;
  39. > char *argv[];
  40. > { 
  41. >   ...
  42. > }
  43.  
  44. This will work also.  :)
  45.  
  46. -s
  47. -- 
  48. Peter Seebach - seebs@solon.com - Copyright 1996 Peter Seebach.
  49. C/Unix wizard -- C/Unix questions? Send mail for help.  No, really!
  50. FUCK the communications decency act.  Goddamned government.  [literally.]
  51. The *other* C FAQ - http://www.solon.com/~seebs/c/c-iaq.html
  52.